home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / dviware / crudetype / version3 / nosve.ch < prev    next >
Text File  |  1991-11-28  |  7KB  |  264 lines

  1. % nosve.ch -*-mode: change; webfile: crudetype.web version 3.01;-*-
  2.  % LINEPRINTER Change file for Crudetype
  3. % NOS/VE Version 1.0 changed by Matthias Rawohl Sept./Okt. 1987
  4. % Altered by RMD to fit Crudetype version 1 , May 1988.
  5. % Altered by RMD to fit Crudetype version 2, Oct 1988.
  6. % Altered by RMD to fit Crudetype version 3, Oct 1990.
  7. %
  8. %  COPYRIGHT ( C ) G-H Knauf, 1988.
  9. %
  10. %  Permission is given to any person to make and distribute copies of this
  11. %  software, subject to the following conditions:
  12. %
  13. %  1. All copies of the software must carry an exact copy of this notice.
  14. %
  15. %  2. This software is distributed free of charge, "AS IS" with absolutely no
  16. %  guarantee of performance. Any persons receiving or using this software must
  17. %  do so entirely at their own risk. Neither the authors nor their institutions
  18. %  accept any liability for defects of this software, or for any consequential
  19. %  loss or damage however caused.
  20. %
  21. %  3. Any person who changes this software must clearly mark it as modified and
  22. %  add a note describing the changes made.
  23. %
  24.  
  25.  
  26. %  WEAVE: New title
  27. @x  Module 0; Lines 42 -- 42
  28. \pageno=\contentspagenumber \advance\pageno by 1
  29. @y
  30. \pageno=\contentspagenumber \advance\pageno by 1
  31. \def\title{Crudetype for {\mc NOS-VE}}
  32. @z
  33.  
  34. @x  Module 4; Lines 213 -- 216
  35. @d banner=='This is Crudetype, Version 3.01, copyright, experimental'
  36. {printed when the program starts}
  37.  
  38. @p program crudetype
  39. @y
  40. The identifier |value| is a reserved word in NOS/VE Pascal, so we have to
  41. change this into the word |values|.
  42. @d value ==values
  43. @d banner=='This is Crudetype, NOS/VE Version 3.01, modified by MR'
  44. {printed when the program starts}
  45.  
  46. @p program crudetype@&_@&module
  47. @z
  48.  
  49. @x  Module 6; Lines 250 -- 250
  50.   @<Read \.{DVI} preamble@>
  51. @y
  52.   @<Read \.{DVI} preamble@>
  53.   page( printfile) ;
  54. @z
  55.  
  56. @x  Module 14; Lines 360 -- 361
  57. @<Lowest...@>=
  58.   {Declare |parse_file|}
  59. @y
  60. @<Lowest...@>=
  61.   procedure  parse_file( name: var_string; var dir, nam, ex: var_string) ;
  62.   var p,q,r,s: s_ptr ;
  63.   begin
  64.     dir := blank; nam := blank; ex := blank;
  65.     s := name.len ;
  66.     if ( s>0) then begin
  67.       p := s_search( name, '.', -s);
  68.       if ( p>0) then substring( dir, name, 1, p) ;
  69.       r := s_search( name, '_', -s);
  70.       if ( r>p) then substring( ex, name, r, s-r+1)
  71.       else r := s +1 ;
  72.       substring( nam, name, p+1, r-p-1) ;
  73.     end;
  74.   end;
  75. @z
  76.  
  77. @x  Module 17; Lines 418 -- 420
  78. @ As an initial attempt at downloading, we declare a |@!raster_file|.
  79.  
  80. @<Files@>= term_in, term_out, printfile, dvi_file, tfm_file, raster_file
  81. @y
  82. @ Instead of reading a command line, NOS-VE Pascal declares its parameters in
  83. the program header. This is an excellent system, except there is apparently no
  84. way to specify defaults. As an initial attempt at downloading, we declare a
  85. |@!raster_file|.
  86.  
  87. @<Files@>= term_in, term_out, printfile, dvi_file, tfm_file, raster_file,
  88.   quiet, run_on, squash, first_page, count_pages, magnify, h_mag, v_mag,
  89.   batch_view, inspection
  90. @z
  91.  
  92. @x  Module 18; Lines 429 -- 436
  93. @d block_length = 512
  94. @d same_dir == false
  95.  
  96. @<Set init...@>=
  97.   be_string( '.DVI' ) ; dvi_def := buffer ;
  98.   be_string( 'TEX$FONTS:.TFM' ) ; tfm_def := buffer ;
  99.   be_string( 'TEX$GF:.&DGF' ) ; raster_def := buffer ;
  100.   be_string( '.PRI' ) ; print_ex := buffer ;
  101. @y
  102. @d block_length = 16
  103. @d same_dir == false
  104.  
  105. @<Set init...@>=
  106.   be_string( '_DVI' ) ; dvi_def := buffer ;
  107.   be_string( ':$LIB.PUBLIC.TEX.TFM._TFM' ) ; tfm_def := buffer ;
  108.   be_string( '$LIB.PUBLIC.TEX.GFDIR._&DGF' ) ; raster_def := buffer ;
  109.   be_string( '_LST' ) ; print_ex := buffer ;
  110. @z
  111.  
  112. @x  Module 19; Lines 442 -- 443
  113. @<Lowest...@>=
  114.   {Declare |open_binary|}
  115. @y
  116.  
  117. In NOS/VE you have two choices: you may use either the NOS/VE Pascal extension
  118. |bindingtype| or the Cybil routines developed by Norbert Schwarz for his \TeX\
  119. implementation for NOS/VE. Norbert's routines are smarter if a TFM file is
  120. missing.
  121.  
  122. RMD:  I hope to distribute N.Schwarz's routines in the file NOSVEBIND.CYB.
  123. Dont ask me how these work, I have no idea. The next lot of macro definitions
  124. is rather messy; I have tried to clean them up. To switch from Cybil binding
  125. to (NOS) Pascal binding, swop the curly brackets in the next two definitions.
  126.  
  127. @d PASCL ==@{   {Open curly for Cybil binding}
  128. @d CYBIL ==@}   {Close curly for Cybil binding}
  129.  
  130. @d close_binary(#)==
  131.     close_read (#)
  132.  
  133. @<Lowest...@>=
  134.   @{ CYBIL
  135.  
  136. @#
  137.   procedure close_read(var f_f:byte_file); external;
  138.  
  139. @#
  140.   function open_binary (
  141.     var f_f: byte_file; name: var_string ): boolean;
  142.   type string_type=string(64);
  143.   var s: integer;
  144.   long_name_of_file, effectiv_file_name : string_type;
  145.   procedure open_read(
  146.     var f_f:byte_file; given_name:string_type;
  147.     is_text_file:boolean;
  148.     var effectiv_file_name: string_type;
  149.     var open_error:integer);
  150.   external;
  151.   begin
  152.     close_binary(f_f );
  153.       {in case the file was left open}
  154.     long_name_of_file := substr( name.data,1,64);
  155.     open_read(f_f,long_name_of_file, false,effectiv_file_name,s);
  156.     if s <> 0 then open_binary := false
  157.     else begin
  158.       reset(f_f );
  159.       open_binary := true ;
  160.     end;
  161.   end;
  162.  
  163. @#
  164.   PASCL PASCL
  165.  
  166. @#
  167.   procedure close_read(var f_f:byte_file); begin  unbind(f_f) end;
  168.  
  169. @#
  170.   function open_binary (
  171.     var f_f: byte_file; name: var_string; ): boolean;
  172.   var file_bind : @=bindingtype@> ;   { a predefined type in NOS/VE-Pascal}
  173.   begin
  174.     file_bind:=binding(f_f);
  175.     if file_bind.bound then unbind(f_f);
  176.       {in case the file was left open}
  177.     file_bind.name := substr( name.data,1,string_length);
  178.     bind(f_f,file_bind);
  179.     file_bind:= binding(f_f);
  180.     open_binary := file_bind.bound;
  181.     if file_bind.bound  then reset(f_f);
  182.   end;
  183.  
  184. @#
  185.   CYBIL @}
  186. @z
  187.  
  188. @x  Module 23; Lines 495 -- 500
  189. @<Determine operating parameters@>=
  190.   command := blank ; get_command ;
  191.   dvi_name := blank ;
  192.   if got_cl then parse_command ;
  193.   @<Get \.{DVI} file name and open it@> ;
  194.   if not got_cl then @<Ask the user@> ;
  195. @y
  196. NOS/VE uses a quite different mechanism; the parameters are passed in as
  197. arguments to the |PROGRAM| statement.
  198.  
  199. @<Determine operating parameters@>=
  200.   reset( dvi_file) ; dvi_indx := 0 ;
  201.   rewrite(printfile) ;
  202.   display_ln(' ',banner, ' --- ', device_ID) ;
  203. @z
  204.  
  205. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  206. % change for Crudetype NOS/VE Version 2.1
  207. % MR 10.4.89
  208. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  209. @x  Module 24; Lines 525 -- 535
  210. @<Set init...@>=
  211.   quiet := false ;
  212.   run_on := false ;
  213.   squash := false ;
  214.   magnify := 100 ;
  215.   h_mag := 100 ;
  216.   v_mag := 100 ;
  217.   batch_view := false ;
  218.   first_page := -1000000 ;
  219.   count_pages := 1000000 ;
  220.   print_name := blank ;
  221. @y
  222. @z
  223.  
  224. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  225. % change for Crudetype NOS/VE Version 2.1
  226. % MR 1.4.89
  227. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  228. @x  Module 86; Lines 1510 -- 1517
  229.   if not quiet then begin
  230.     display_ln( ' ');
  231.     string_show( font_name);
  232.     display( ' --- loaded at ',scale_size:1,' DVI units');
  233.     if abs(font_mag) > 1 then
  234.       display(' ( magnified ', round(font_mag):1,'%)');
  235.     display_ln(' ');
  236.   end;
  237. @y
  238.  
  239. @z
  240.  
  241. @x  Module 207; Lines 3474 -- 3474
  242.   fortran := false ;
  243. @y
  244.   fortran := true ;
  245. @z
  246.  
  247. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  248. % change for Crudetype NOS/VE Version 2.1
  249. % MR 1.4.89
  250. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  251. @x  Module 212; Lines 3577 -- 3580
  252.   if not quiet then begin
  253.     display ('Output written to file:  ');
  254.     string_show(print_name);
  255.   end;
  256. @y
  257.   { display ('Output written to file:  ');
  258.     ====> task moved to SCL Command file }
  259. @z
  260.  
  261.  
  262.  
  263.  
  264.